/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package rg1schoolclassdemo;

import java.util.Comparator;

/**
 *
 * @author apple
 */
public class CompareByNum implements Comparator<Student>
{

    @Override
    public int compare(Student o1, Student o2) {
        if(o1.getNum()>o2.getNum()) return 1;
        if(o1.getNum()<o2.getNum()) return -1;
        return 0;
    }
    
}
